#include "camera.h"

Camera::Camera(int device)
{
    cap.open(device);
}

cv::Mat Camera::getNextFrame()
{
    cv::Mat frame;

    if(cap.isOpened()) {
        cap >> frame;
    }

    return frame;
}

int Camera::get(int propId)
{
    return cap.isOpened() ? cap.get(propId) : -1;
}

Camera::~Camera()
{
    cap.release();
}
